﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using GTS.Channel.Api;
using GTS.Channel.Api.Entity;
using GTS.Channel.Api.Helper;
using Pub.Class;

namespace WebAppSPIO
{
    public partial class yitong : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                try
                {
                    string strlinkid = string.Empty,//唯一标识，深圳瑞通2
                        strmobile = string.Empty,//手机号
                        strcontent = string.Empty,//内容 
                        strspnum = string.Empty,//通道号码
                        strstatus = string.Empty;//状态报告DELIVRD表示成功


                    if (Request.QueryString["linkid"] != null)
                        strlinkid = Request.QueryString["linkid"].ToString();
                    if (Request.QueryString["mobile"] != null)
                        strmobile = Request.QueryString["mobile"].ToString();
                    if (Request.QueryString["content"] != null)
                        strcontent = Request.QueryString["content"].ToString();
                    if (Request.QueryString["spnumber"] != null)
                        strspnum = Request.QueryString["spnumber"].ToString();

                    if (string.IsNullOrEmpty(strlinkid) || string.IsNullOrEmpty(strmobile) || string.IsNullOrEmpty(strspnum))
                    {
                        Response.Write("err");
                        return;
                    }

                    ChannelDealData info = new ChannelDealData();
                    info.SPCode = "yitong";

                    //接收值
                    info.LinkID = strlinkid;
                    info.Mobile = strmobile;
                    info.LongPhone = strspnum;
                    info.ReceiveQuery = strcontent;
                    info.ResponseStatus = 1;
                    info.MRDate = DateTime.Now;

                    if (Base.SetRequestMRinfo(info))
                    {
                        Response.Write("ok");
                    }
                    else
                    {
                        Response.Write("err");
                    }
                }
                catch (Exception ex)
                {
                    Base.WriteLogEnd(ex.ToString());
                    Response.Write("err");
                }
            }
        }
    }
}